$(function () {

    var arr = [
        {"username":"zhangsan",age:18},
        {"username":"lisa",age:20}
    ];
    for(var i = 0;i < arr.length; i++) {
        var j = arr[i];
        //创建2个tr标签
        var trObj = $("<tr>");
        trObj.html("<td>"+j.username+"</td><td>"+j.age+"</td>");
            $("#tab").append(trObj);
    }
})